<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Hash;
use DB;
class GoodsCarController extends Controller
{
    //用户列表显示
    public function getList(Request $request)
    {
        $users=DB::table('user')->
            orderBy('id','desc')->
            where(function($query)use($request){
                $keyword=$request->input('keyword');
                if($keyword){
                    $query->where('username','like','%'.$keyword.'%');
                }
            })
            ->paginate($request->input('num',10));
        return view('admin.goodscar.list',['users'=>$users,'request'=>$request]);
    }

    //查看购物车详细信息
    public function getDetail(Request $request)
    {
        //获取购物车表内容
        $goodscar=DB::table('goodscar')->get();
        // dd($goodscar);
        return view('admin.goodscar.carlist',['goodscar'=>$goodscar,'request'=>$request]);
    }
}
